package nc.vo.gsp.pub.monthsum;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

@SuppressWarnings( { "unchecked", "serial", "deprecation", "unused" })
public class QryCondStr implements Serializable {

	public static void main(String[] args) {
	}

	private HashMap m_nameToValue = new HashMap();

	public void set(String name, String value) {
		m_nameToValue.put(name, value);
	}

	public String get(String name) {
		return (String) m_nameToValue.get(name);
	}

	public String[] getNames() {
		if (m_nameToValue.size() <= 0)
			return null;

		Set s = m_nameToValue.entrySet();
		Iterator iter = s.iterator();
		ArrayList al = new ArrayList();
		while (iter.hasNext()) {
			Map.Entry en = (Map.Entry) iter.next();
			al.add(en.getKey());
		}
		if (al.size() > 0) {
			return (String[]) al.toArray(new String[al.size()]);
		}
		return null;

	}

	public String[] getValues() {
		if (m_nameToValue.size() <= 0)
			return null;

		Set s = m_nameToValue.entrySet();
		Iterator iter = s.iterator();
		ArrayList al = new ArrayList();
		while (iter.hasNext()) {
			Map.Entry en = (Map.Entry) iter.next();
			al.add(en.getValue());
		}
		if (al.size() > 0) {
			return (String[]) al.toArray(new String[al.size()]);
		}
		return null;
	}
}